package com.rui.builder.model;

import com.rui.builder.obj.Computer;
import lombok.AllArgsConstructor;

/**
 * 指挥者类 指挥该组装什么电脑
 */
@AllArgsConstructor
public class ComputerDirector {

    private ComputerBuilder computerBuilder;

    public Computer construct() {
        computerBuilder.buildMotherboard();
        computerBuilder.buildCpu();
        computerBuilder.buildMemory();
        computerBuilder.buildDisk();
        computerBuilder.buildGpu();
        computerBuilder.buildHeatSink();
        computerBuilder.buildPower();
        computerBuilder.buildChassis();
        return computerBuilder.build();
    }
}